package com.yoomiito.app.widget.dialog

import android.content.Context
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import android.view.Gravity
import android.view.View
import com.yoomiito.app.R
import com.yoomiito.app.utils.ColorUtils
import com.yoomiito.app.utils.DensityUtil

class RcyDialog(context: Context,styleRes:Int = R.style.dialog_2) :BaseDialog(context,styleRes){

    lateinit var mAdapter: androidx.recyclerview.widget.RecyclerView.Adapter<androidx.recyclerview.widget.RecyclerView.ViewHolder>
    var mLayoutManager: androidx.recyclerview.widget.RecyclerView.LayoutManager = androidx.recyclerview.widget.LinearLayoutManager(context)

    override fun setView(): View {
        val rcy = androidx.recyclerview.widget.RecyclerView(context)
        rcy.background = ColorUtils.gradientAndRadius("#ffffff","#ffffff",0f,0f,20f,20f)
        rcy.setPadding(DensityUtil.dp2px(15f),DensityUtil.dp2px(20f),DensityUtil.dp2px(15f),DensityUtil.dp2px(20f))
        rcy.layoutManager = mLayoutManager
        rcy.adapter = mAdapter
        setWidthPercent(1.0)
        setmGravity(Gravity.TOP)
        return rcy
    }

}